import request from '/@/utils/request';


const evaPath = '/eva';

// 查询量表基本信息 列表
export function listScale(query?: Object) {
  return request({
    url: evaPath + '/scales/page',
    method: 'get',
    params: query
  })
}

// 查询量表基本信息 详细
export function getScale(id?: string) {
  return request({
    url: evaPath + '/scales/' + id,
    method: 'get'
  })
}

// 新增量表基本信息
export function addScale(data?: Object) {
  return request({
    url: evaPath + '/scales',
    method: 'post',
    data: data
  })
}

// 修改量表基本信息
export function updateScale(data?: Object) {
  return request({
    url: evaPath + '/scales',
    method: 'put',
    data: data
  })
}

// 删除量表基本信息
export function delScale(id: string) {
  return request({
    url: evaPath + '/scales/' + id,
    method: 'delete'
  })
}

// 量表列表
export function scaleOption(query?: Object) {
  return request({
    url: evaPath + '/scales/option',
    method: 'get',
    params: query
  })
}

// 问题列表
export function questionList(id: string, query?: Object) {
  return request({
    url: evaPath + '/scales/' + id + '/questions',
    method: 'get',
    params: query
  })
}

// 因子列表
export function factorOption(id: string, query?: Object) {
  return request({
    url: evaPath + '/scales/' + id + '/factors',
    method: 'get',
    params: query
  })
}
